home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 3DTOSHI2.ZIP / mpgfx / include / gfxpcx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-23  |  1.7 KB  |  63 lines

  1.  
  2. // gfxpcx.h
  3. //
  4. // Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.
  5.  
  6. #ifndef __GFXPCX_H__
  7. #define __GFXPCX_H__
  8.  
  9. #include "stdgfx.h"
  10. #include "gfxifile.h"
  11.  
  12. struct PCXHEADER
  13.   {
  14.     BYTE  ID;
  15.     BYTE  Version;
  16.     BYTE  Encoding;
  17.     BYTE  BitsPerPixel;
  18.     SHORT XMin;
  19.     SHORT YMin;
  20.     SHORT XMax;
  21.     SHORT YMax;
  22.     SHORT XResolution;
  23.     SHORT YResolution;
  24.     RGBCOLOR Palette[16];
  25.     BYTE  Reserved;
  26.     BYTE  NumPlanes;
  27.     SHORT BytesPerRow;
  28.     SHORT PalType;  // 1 for Color or B & W, 2 for Gray scale
  29.     SHORT XScreen;
  30.     SHORT YScreen;
  31.     BYTE  Filter[54];
  32.   }; // End of PCXHEADER
  33.  
  34. class PCXFILETOOL : public IMAGEFILETOOL
  35.   {
  36.     protected :
  37.       PCXHEADER PCXHeader;
  38.       BYTE *DataBuffer;
  39.  
  40.       BOOLEAN ReadHeader ();
  41.       BOOLEAN ReadImageRow2 ( IMAGE *Image, INT Row );
  42.       BOOLEAN ReadImageRow4 ( IMAGE *Image, INT Row );
  43.       BOOLEAN ReadImageRow16 ( IMAGE *Image, INT Row );
  44.       BOOLEAN ReadImageRow256 ( IMAGE *Image, INT Row );
  45.       BOOLEAN ReadImage ( IMAGE *Image );
  46.       BOOLEAN ReadPalette ( RGBPALETTE *Pal );
  47.  
  48.       BOOLEAN WriteHeader ( INT Wd, INT Ht );
  49.       BOOLEAN WriteImageRow256 ( IMAGE *Image, INT Sx, INT Wd, INT WhichRow );
  50.       BOOLEAN WriteImage ( IMAGE *Image, INT Sx, INT Sy, INT Wd, INT Ht  );
  51.       BOOLEAN WritePalette ( RGBPALETTE *Pal );
  52.  
  53.     public :
  54.       PCXFILETOOL ( FILEHANDLE f );
  55.       virtual ~PCXFILETOOL ();
  56.  
  57.       virtual BOOLEAN LoadImage ( IMAGE *Image, RGBPALETTE *Pal );
  58.       virtual BOOLEAN SaveImage ( IMAGE *Image, LONG Sx, LONG Sy,
  59.                                   LONG Wd, LONG Ht, RGBPALETTE *Pal  );
  60.   }; // End of PCXFILETOOL class
  61.  
  62. #endif
  63.